package com.hqq.action.clazz.iterator;

/**
 * IteratorTest
 * 迭代子模式
 * 顺序访问聚集中的对象
 * Created by heqianqian on 2017/3/11.
 */
public class IteratorTest {
    public static void main(String[] args) {
        Collection collection = new MyCollection();
        Iterator iterator = collection.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
